home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / totsrc11.zip / TOTIO2.PAS < prev    next >
Pascal/Delphi Source File  |  1993-05-04  |  63KB  |  2,361 lines

  1. {               Copyright 1991 TechnoJock Software, Inc.               }
  2. {                          All Rights Reserved                         }
  3. {                         Restricted by License                        }
  4.  
  5. {                             Build # 1.10a                            }
  6.  
  7. Unit totIO2;
  8. {$I TOTFLAGS.INC}
  9.  
  10. {
  11.  Development Notes:
  12.           2/23/91   1.00a    Fixed '-' '+' character validation on
  13.                              RealIOOBJ and FixedRealIOOBJ
  14.           3/29/91   1.00b    Added SetValue to LinkIOOBJ
  15.           4/08/91   1.00c    Problem entering negative exponents in RealIOOBJ
  16.           5/20/91   1.00d    Corrected right justification on IntIOOBJ and RealIOOBJ
  17.                     1.00e    Stopped cursor move when list field not selected
  18.           5/23/91   1.00f    Added reaction to Mouse method 1
  19.           6/11/91   1.00g    Corrected EraseDefault in FixedRealIOOBJ
  20.           7/2/91    1.00h    Added IsNull methods to descendants of SingleLineIOOBJ
  21.           7/23/91   1.00i    Corrected treatment of right-justified strings
  22.  
  23.           9/04/91   1.00j    Added SetNull methods to descendants of SingleLineIOOBJ
  24.          10/03/91   1.00k    Removed #027 dependancy in CharIOOOBJ and FixedRealIOOBJ
  25.          11/19/91   1.00l    Corrected Cursor movement problem with Erase
  26.          02/03/92   1.00m    Changed decimal calc in E notation real fields
  27.          06/23/92   1.00n    Fixed CharOK for Pictures during EraseDefault,
  28.                              added PosCursor to SetValue, and changed
  29.                              vFirstKey logic for null chars.
  30.          09/28/92   1.00o    Corrected EraseDefault setting when mouse use
  31.                              to change field. Updated cursor logic in fixed
  32.                              real when erase default active.
  33.          01/04/93   1.10     Added MoveCursor to Display
  34.          05/03/93   1.10a    Modified LISTIOOBJ.getValue to return 0 (INC file)
  35. }
  36.  
  37. INTERFACE
  38.  
  39. uses DOS, CRT,
  40.      totSYS, totLOOK, totFAST, totSTR, totINPUT, totWIN,
  41.      totIO1, totMSG,  totLINK, totReal, totDATE;
  42.  
  43. CONST
  44.    NumberError: array[1..2] of string[60] =
  45.    (' The number you entered is out of range. ',
  46.    ' Enter a number in the following range: ');
  47.    DateError: array[1..6] of string[60] = 
  48.    (' The date you entered is invalid. ',
  49.     ' Enter a date in the format:',
  50.     ' The date you entered is too early. ',
  51.     ' The earliest acceptable date is: ',
  52.     ' The date you entered is too late. ',
  53.     ' The latest acceptable date is: ');
  54.  
  55. TYPE
  56. pSingleLineIOOBJ = ^SingleLineIOOBJ;
  57. SingleLineIOOBJ = object (VisibleIOOBJ)
  58.    vInsert: boolean;      {is field initially in insert mode}
  59.    vRules: byte;          {erasedefault, jumpiffull..... etc.}
  60.    vFirstKey: boolean;    {has the user entered a key yet}
  61.    vDispChar: char;       {character displayed when key is pressed}
  62.    vPad : Char;           {character used to pad empty part of field}
  63.    {methods ...}
  64.    constructor Init;
  65.    procedure   SetIns(InsOn:boolean);
  66.    procedure   SetRules(Rules:byte);
  67.    procedure   SetDispChar(Ch:char);
  68.    procedure   SetPadChar(Pad:char);
  69.    procedure   SetFieldAttr(Status:tStatus; var Attr:byte; var Str:string);
  70.    procedure   InsertAction(InsOn:boolean);                     VIRTUAL;
  71.    destructor  Done;                                            VIRTUAL;
  72. end;  {SingleLineIOOBJ}
  73.  
  74. pCharIOOBJ = ^CharIOOBJ;
  75. CharIOOBJ = object (SingleLineIOOBJ)
  76.    vFieldLen: byte;
  77.    vMaxlen : byte;
  78.    vInputStr: StrScreen;
  79.    vCursor: tCursPos;     {cursleft cursright cursprevious}
  80.    vCursorStr: byte;      {position of cursor in string}
  81.    vJust: tJust;          {left center right}
  82.    {methods ...}
  83.    constructor Init(X,Y,FieldLen: byte);
  84.    procedure   SetJust(Just:tJust);
  85.    procedure   SetCursor(Curs: tCursPos);
  86.    procedure   ClearMessage;
  87.    function    IsNull:boolean;
  88.    procedure   SetNull;
  89.    function    ProcessKey(InKey:word;X,Y:byte):tAction;         VIRTUAL;
  90.    function    CharOK(var Ch:char): boolean;                    VIRTUAL;
  91.    procedure   Erase;                                           VIRTUAL;
  92.    procedure   CursorEnd;                                       VIRTUAL;
  93.    procedure   CursorHome;                                      VIRTUAL;
  94.    procedure   CursorLeft;                                      VIRTUAL;
  95.    procedure   CursorRight;                                     VIRTUAL;
  96.    procedure   DeleteChar;                                      VIRTUAL;
  97.    procedure   Backspace;                                       VIRTUAL;
  98.    procedure   MoveCursor;                                      VIRTUAL;
  99.    function    ProcessEnter:tAction;                            VIRTUAL;
  100.    procedure   ReDisplay(Status:tStatus);                       VIRTUAL;
  101.    procedure   InitCursor;                                      VIRTUAL; {1.00n}
  102.    procedure   PosCursor;                                       VIRTUAL;
  103.    procedure   Display(Status:tStatus);                         VIRTUAL;
  104.    procedure   ProcessChar(Ch:char);                            VIRTUAL;
  105.    procedure   Activate;                                        VIRTUAL;
  106.    function    Select(K:word; X,Y:byte): tAction;               VIRTUAL;
  107.    function    Suspend:boolean;                                 VIRTUAL;
  108.    destructor  Done;                                            VIRTUAL;
  109. end; {object CharIOOBJ}
  110.  
  111. pStringIOOBJ = ^StringIOOBJ;
  112. StringIOOBJ = object (CharIOOBJ)
  113.    vCase: tCase;            {lower upper proper}
  114.    vForceCase: boolean;     {adjust case of characters during input}
  115.    {methods ...}
  116.    constructor Init(X,Y,FieldLen: byte);
  117.    procedure   SetCase(Cas:tCase);
  118.    procedure   SetForceCase(On:boolean);
  119.    procedure   SetValue(Str:string);
  120.    function    GetValue: string;
  121.    procedure   ReDisplay(Status:tStatus);                   VIRTUAL;
  122.    destructor  Done;                                        VIRTUAL;
  123. end; {StringIOOBJ}
  124.  
  125. pPictureIOOBJ = ^PictureIOOBJ;
  126. PictureIOOBJ = object (StringIOOBJ)
  127.    vPicture: string[80];
  128.    vCursorScr: byte;          {position of cursor including format characters}
  129.    vAllowChar: string[40];    {allowable characters}
  130.    vDisAllowChar: string[40]; {disallowed characters}
  131.    {methods ...}
  132.    constructor Init(X,Y: byte;Pic:string);
  133.    function    InputChars: byte;
  134.    function    CursorOffset(InputPos:byte):byte;
  135.    procedure   SetAllowChar(Str:string);
  136.    procedure   SetDisallowChar(Str:string);
  137.    function    GetValue: string;
  138.    function    GetPicValue: string;
  139.    function    CharOK(var Ch:char):boolean;                 VIRTUAL;
  140.    procedure   Erase;                                       VIRTUAL;
  141.    procedure   CursorEnd;                                   VIRTUAL;
  142.    procedure   CursorHome;                                  VIRTUAL;
  143.    procedure   CursorLeft;                                  VIRTUAL;
  144.    procedure   CursorRight;                                 VIRTUAL;
  145.    procedure   DeleteChar;                                  VIRTUAL;
  146.    procedure   Backspace;                                   VIRTUAL;
  147.    procedure   PosCursor;                                   VIRTUAL;
  148.    procedure   InitCursor;                                  VIRTUAL;
  149.    procedure   MoveCursor;                                  VIRTUAL;
  150.    procedure   ReDisplay(Status:tStatus);                   VIRTUAL;
  151.    destructor  Done;                                        VIRTUAL;
  152. end; {PictureIOOBJ}
  153.  
  154. pLateralIOOBJ = ^LateralIOOBJ;
  155. LateralIOOBJ = object (StringIOOBJ)
  156.    vStartChar: byte;         {the number of the first visible character}
  157.    {methods ...}
  158.    constructor Init(X,Y,FieldLen,MaxLen: byte);
  159.    function    CursorOffset(InputPos:byte):byte;
  160.    procedure   SetNull;
  161.    function    GetValue: string;
  162.    procedure   Erase;                                       VIRTUAL;
  163.    procedure   CursorEnd;                                   VIRTUAL;
  164.    procedure   CursorHome;                                  VIRTUAL;
  165.    procedure   CursorLeft;                                  VIRTUAL;
  166.    procedure   CursorRight;